<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <iframe id='iframe' src="http://192.168.1.4:8080/b.html" frameborder="0" style="display: none;"></iframe>
    <script>
        window.onload = function () {
            document.getElementById("iframe").contentWindow.postMessage('你好', "http://192.168.1.4:8080/b.html")

            window.onmessage = function (ev) {
                console.log(ev.data)
            }
        }
    </script>

</body>

</html>